<?php $this->_extends('_layouts/bocib_layout'); ?>

<?php $this->_block('content');?>

<div id="content">
    <h2>教师信息</h2>
    <table>
        <thead>
            <tr>
                <th>姓名</th>
                <th>系别</th>
                <th>头衔</th>
                <th>Email</th>
                <th>Phone</th>
                <th>fax</th>
                <th>密码</th>
                <th>状态</th>
                <th>删除</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach(Teacher::find()->all()->query() as $teacher) { ?>
            <tr>
                <td><?=$teacher->name;?></td>
                <td><?=$teacher->major->major;?></td>
                <td>
					<?php
					foreach($teacher->titles as $title)
					{
						echo $title->title,' ';
					}
					?>
				</td>
                <td><?=$teacher->email;?></td>
                <td><?=$teacher->phone;?></td>
                <td><?=$teacher->fax;?></td>
                <td><?=$teacher->accesscode;?></td>
                <td><?=$teacher->status;?></td>
                <?php if($teacher->status == 'in') { ?>
                <td>
        <a href="<?=url('bofaculty/deleteteacher', array('teacher_id'=>$teacher->teacher_id));?>">删除</a>
                </td>
                <?php } else { ?>
                <td>
        <a href="<?=url('bofaculty/retriveteacher', array('teacher_id'=>$teacher->teacher_id));?>">恢复</a>
                </td>
                <?php } ?>
            </tr>
            <?php } ?>
        </tbody>
    </table>
</div>

<?php $this->_endblock('content');?>